package com.example.androidperformance;

import com.example.data.PhotoListAdapter;
import com.example.data.PhotoStory;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends Activity
{

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		initView();
	}
	
	private void initView()
	{
		ListView list = (ListView) findViewById(R.id.listView1);
		ArrayAdapter<PhotoStory> photoStoryAdapter = new PhotoListAdapter(this, -1);
		list.setAdapter(photoStoryAdapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu)
	{
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

}
